home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / graphics / 3dvect30.arj / TGA2ICON.ARJ / TGA2ICON.DOC < prev    next >
Text File  |  1993-08-10  |  4KB  |  87 lines

  1.  
  2.  
  3.      This will be reaaall short:
  4.  
  5.    The purpose if TGA2ICON is to take a 24 bit targa file and convert  is  to
  6.    an assembley file with the x and y size of the  targa  file   at  the  top
  7.    two words of the assembley file. This can then be used for the routines in
  8.    3dvect20.zip
  9.  
  10.    Lets say you've raytraced a really neet object and want to convert it to an
  11.    icon for use in animation/graphics program.  This will allow you to seperate
  12.    the colour palette, sort it, and generate a x and y icon with indexers to
  13.    that palette, in assembler form.
  14.  
  15.    FAQ (frequently asked questions, for those who don't know what FAQ is!)
  16.  
  17.    Q - Why did you write a utility in protected mode!?!
  18.  
  19.    A - It was easy.  Re-write it if you like your computer bogged down
  20.        with memory managers. The new pmode code allows emm386 to run with this
  21.  
  22.    Q - God that code is sloppy!  I could write better in my sleep!
  23.  
  24.    A - So could I. In fact, I think I did write it in my sleep.  The code
  25.        is sloppy but it works and who cares!  (I'm actually quite embarrased
  26.        about the poor code quality and considered not releasing the file!)
  27.  
  28.    Q - Why decode a TGA file, why not a GIF?
  29.  
  30.    A - I didn't want to think.  (Typical brain dead programmer).  TGA is easy
  31.        to work with and I didn't want to import code to decode gif for just
  32.        a simple utility.
  33.  
  34.    Command line options:
  35.  
  36.     tga2icon filename [/a#]
  37.  
  38.     eg tga2icon picture.tga
  39.        tga2icon newmouse.tga /a48
  40.  
  41.     The program will scan the TGA to find how many colours there are in it.
  42.     It will then sort the colours according to the RGB values.  The output
  43.     will begin with those colours in a palette style of table followed by their
  44.     sorted equivalent indexers. This way, you have access to the bitmap and the
  45.     palette seperatly.
  46.  
  47.     This is where the /a (add) option comes in.  If you want this icon to have
  48.     it's palette starting at, lets say, colour 32, simply use  /a32 option and
  49.     all indexers to the palette will start at colour 32.  The darkest colour will
  50.     be colour 32 and the lightest will be 32+howevermanycolours.
  51.  
  52.     The output file is always called ????????.inc
  53.  
  54.     There are a maximum of 256 colours extraced from the TGA file.
  55.  
  56.     The batches:
  57.  
  58.     I have included some batch files to show you what I use to convert tgas to
  59.     icons.  I have Image Alchemy and this is what the batch files need to run.
  60.     Change the batches to whatever convert program you use.
  61.  
  62.     To convert a 24 bit targa to a 16 colour icon, use alc1.bat  It will convert
  63.     the file to a 17 colour gif (zero is not considered a colour in the icon)
  64.     then convert that back to the original 24 bit TGA.  The batch will call
  65.     TGA2ICON and convert that new 16 colour tga into an assembley file with
  66.     a sorted palette and indexers to that palette.  Alc2.bat uses the same
  67.     techneque but uses 32 colours instead.  To recap, thats TGA to GIF, then
  68.     back to original TGA, then to assembler .inc file.
  69.  
  70.     Alcgif.bat will convert a gif to a tga the to an assembler .inc file.
  71.  
  72.     Use alc1 or alc2 if you have a raytraced TGA and Alcgif if you are
  73.     converting a handdrawn GIF to an icon.
  74.  
  75.     If you don't like the program, delete it.  Like I said, it was for my
  76.     personal use only!  If you like it/use it but want more features, I can be
  77.     reached at:
  78.  
  79.       John McCarthy
  80.       1316 Redwood Lane
  81.       Pickering, Ontario
  82.       L1X 1C5
  83.  
  84.  
  85.     BTW: John McCarthy thanks TRAN for providing the protected mode header
  86.  
  87.